//
//  Controller.h
//  Genesis
//
//  Created by Kristoffer Andersen on 31/12/08.
//  Copyright 2008 Kristoffer Andersen. All rights reserved.
//
//  This file is part of Genesis.
//  
//  Genesis is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//  
//  Genesis is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with Genesis.  If not, see <http://www.gnu.org/licenses/>.


#import <Cocoa/Cocoa.h>
#import "shhTunnel.h"
#import "tunBonjour.h"
#import "ConnectionsController.h"


@interface Controller : NSObject {
	
	////////////////////////////////////////////////////////////////
	// Object variables
	
	NSStatusItem *theItem;
	NSView *statusView;
	NSWindowController *mainWindowController;
	NSTimer *timer;
	unsigned int timerSecs;
	unsigned int timerMins;
	unsigned int timerHours;
	
	
	//shhTunnel *mySSH;                     //from Genesis ver. 1.0
	//tunBonjour *myBonjour;                //from Genesis ver. 1.0
	//NSMutableString *myTermStr;           //from Genesis ver. 1.0
	//NSNetServiceBrowser *myBrowser;       //from Genesis ver. 1.0
	//BOOL SSHdone;                         //from Genesis ver. 1.0
	
	////////////////////////////////////////////////////////////////
	// Outlets
	
	IBOutlet ConnectionsController *connController;
	IBOutlet NSTextField *statusLabel;
	IBOutlet NSMenu *statusMenu;
	IBOutlet NSMenuItem *statusMenuQuit;
	IBOutlet NSMenuItem *statusMenuShowConn;
	IBOutlet NSMenuItem *statusMenuTimer;
	IBOutlet NSWindow *mainWindow;
	
	//Auth window
	IBOutlet NSWindow *authWindow;
	IBOutlet NSTextField *authPasswordField;
	IBOutlet NSTextField *authUserField;
	IBOutlet NSTextField *authHostField;
	
	//IBOutlet NSButton *connectButton;     //from Genesis ver. 1.0
	//IBOutlet NSButton *disconnectButton;  //from Genesis ver. 1.0
	//IBOutlet NSTextField *serverHost;     //from Genesis ver. 1.0
	//IBOutlet NSTextField *username;       //from Genesis ver. 1.0
	//IBOutlet NSProgressIndicator *spinner;//from Genesis ver. 1.0
	//IBOutlet NSTextView *console;         //from Genesis ver. 1.0
	//IBOutlet NSButton *toggleConsole;     //from Genesis ver. 1.0
	//IBOutlet NSDrawer *consoleDrawer;     //from Genesis ver. 1.0
	
}

////////////////////////////////////////////////////////////////
// Actions

-(IBAction)quitGenesis:(id)sender;
-(IBAction)showMainWindow:(id)sender;
-(IBAction)authConfirmButton:(id)sender;
-(IBAction)authCancelButton:(id)sender;


//-(IBAction)connectButton:(id)sender;       //from Genesis ver. 1.0
//-(IBAction)disconnectButton:(id)sender;    //from Genesis ver. 1.0
//-(IBAction)toggleConsole:(id)sender;       //from Genesis ver. 1.0

////////////////////////////////////////////////////////////////
// Delegates

-(void)activateStatusMenu;
-(void)aConnectionSucceeded;
-(void)showAuthWithHost:(NSString*)host andUser:(NSString*)user;

////////////////////////////////////////////////////////////////
// Timer Notification

-(void)checkTimer:(NSTimer *)aTimer;
-(void)timerValueAsString;

@end
